package com.neymar.mapper;

import com.neymar.entity.Recruiter;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 招聘者表 Mapper 接口
 * </p>
 *
 * @author neymar
 * @since 2021-06-02
 */
public interface RecruiterMapper extends BaseMapper<Recruiter> {

    @Select(
            "select a.*,b.* from information.recruiter a , information.company b\n" +
                    "where a.recruiter_company_id=b.company_id limit ${(current-1)*size},${size}"
    )
    List<Map<String, String>> findAllRecruiterDetails(@Param("current") Integer current, @Param("size") Integer size);


    @Select(
            "select a.*,b.* from information.recruiter a , information.company b " +
                    "where a.recruiter_company_id=b.company_id and a.user_id = ${userId}"
    )
    Map findRecruiter(@Param("userId") String userId);

}
